<?php

namespace console\migrations;

use console\migrations\Base;

/**
 * Handles adding columns to table `{{%patch}}`.
 */
class M200908084842AddCodeColumnToPatchTable extends Base
{
    protected string $tableName = '{{%patch}}';

    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->addColumn($this->tableName, 'code', $this->integer(11)->notNull()->defaultValue(0)->after('id'));
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->dropColumn($this->tableName, 'code');
    }
}
